package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Entity
@Data
@Table(name = "t_it_f5_network_map")
public class ItF5NetworkMap implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "int comment '唯一编号'")
    private Integer id;

    @Column(name = "host", columnDefinition = "varchar(128)")
    private String host;

    @Column(name = "vs_name", columnDefinition = "varchar(128)")
    private String vsName;

    @Column(name = "`partition`", columnDefinition = "varchar(128)")
    private String partition;

    @Column(name = "source", columnDefinition = "varchar(128)")
    private String source;

    @Column(name = "destination", columnDefinition = "varchar(128)")
    private String destination;

    @Column(name = "port", columnDefinition = "varchar(128)")
    private String port;

    @Column(name = "enable", columnDefinition = "varchar(128)")
    private String enable;

    @Column(name = "ip_protocol", columnDefinition = "varchar(128)")
    private String ipProtocol;

    @Column(name = "nat64", columnDefinition = "varchar(128)")
    private String nat64;

    @Column(name = "pool", columnDefinition = "varchar(128)")
    private String pool;

    @Column(name = "sat_type", columnDefinition = "varchar(128)")
    private String satType;

    @Column(name = "profile_name", columnDefinition = "varchar(128)")
    private String profileName;

    @Column(name = "pool_members", columnDefinition = "varchar(1000)")
    private String poolMembers;

    @Column(name = "pool_members_state", columnDefinition = "varchar(128)")
    private String poolMembersState;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;


}
